class Room < ApplicationRecord
  has_many :messages
  belongs_to :sender, class_name: 'User', foreign_key: 'sender_id'
  belongs_to :receiver, class_name: 'User', foreign_key: 'receiver_id'

  # scope :public_rooms, -> { where(is_private: false) }
  # after_create_commit {broadcast_append_to "rooms"}
end
